
/**************************
 *  @brief imu attitude calculation task
 *
 */

#ifndef __IMU_TASK_H__
#define __IMU_TASK_H__

#include "stm32f4xx_hal.h"
#include "bsp_imu.h"
#include "mpu6500_reg.h"

/* imu task period time (ms) */
#define IMU_TASK_PERIOD 1
#define YAWOFFSET 0.00001f
typedef struct
{
  int roll_cnt;
  int pitch_cnt;
  int yaw_cnt;

  float last_roll;
  float last_pitch;
  float last_yaw;

  float roll;
  float pitch;
  float yaw;
} imu_attitude_t;


//extern imu_data_t     imu;
//extern imu_attitude_t atti;
//extern float abs_yaw;

extern struct attitude mahony_atti;
extern struct ahrs_sensor mpu_sensor;

void imu_task(void);
void imu_param_init(void);

//static void imu_temp_ctrl_init(void);
static void imu_temp_keep(void);

#endif
